package day09;

public class stringTools04 {
    public static void main(String[] args) {
//        method1();
        method2();
    }

    private static void method1() {
        StringBuffer str=new StringBuffer();
        String s="abcdefghijklmnopqrstuvwxyz";
        long start=System.currentTimeMillis();
        for (int i = 0; i < 10000; i++) {
            str.append(s);
        }
        System.out.println(str);
        long end=System.currentTimeMillis();
        System.out.print(end-start);
    }

    private static void method2() {
        String s="abcdefghijklmnopqrstuvwxyz";
        StringBuilder str=new StringBuilder();
        long start=System.currentTimeMillis();
        for (int i = 0; i < 10000; i++) {
            str.append(s);
        }
        long end=System.currentTimeMillis();
        System.out.println(str);
        System.out.println(end-start);
    }
}
